package com.common.exception;

public class ServiceException extends RuntimeException{
	
	/**
	 * 前端交互编码
	 * 0 开头表示运行没有异常，执行正确
	 * 1 开头表示需要前端确认
	 * 4 开头表示错误
	 */
	private String code;
	
	private Object info;

	private static final long serialVersionUID = -4682283228694208872L;
	
	public ServiceException(){
		
	}
	
	public ServiceException(String message, String code) {
		super(message);
		this.code = code;
	}
	public ServiceException(String message, String code, Object data) {
		super(message);
		this.code = code;
		this.info = data;
	}

	public ServiceException(String message, Throwable cause,
			boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public ServiceException(String message, Throwable cause) {
		super(message, cause);
	}

	public ServiceException(String message) {
		super(message);
	}

	public ServiceException(Throwable cause) {
		super(cause);
	}
	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}

	public Object getInfo() {
		return info;
	}

	public void setInfo(Object info) {
		this.info = info;
	}

}
